package Command_Pattern.Calculator;

import java.util.ArrayList;
import java.util.List;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class AddCommand extends AbstractCommand{
    private Adder adder=new Adder();
    private int value;
    @Override
    public int execute(int value) {
        this.value=value;
        return adder.add(value);
    }
    public int undo(){
        return adder.add(-value);
    }

    @Override
    public int redo() {
        return adder.add(value);
    }
}
